<?php
  require(dirname(__FILE__).'/global.php');
  
  $menus = $db->query("SELECT CateID,CateName FROM talking_cate ORDER BY CateOrderNo");
  $resources = $db->query("SELECT ResID,ResName,ResVisitNum FROM talking_resource ORDER BY ResTime DESC LIMIT 0,9");
  $links = $db->query("SELECT * FROM talking_link ORDER BY LinkOrderNo");
  $notice = $db->query("SELECT NoticeContent FROM talking_notice WHERE (BarID IS NULL OR BarID = '') ORDER BY NoticeTime DESC LIMIT 0,1");
  $notice = $notice[0][0];
  
  $smarty->assign("menus",$menus);
  $smarty->assign("resources",$resources);
  $smarty->assign("links",$links);
  $smarty->assign("notice",$notice);
  $smarty->display('index.html');
  
  $db->close();
  $log->logInfo("[URL]$visitorURL"); 
?>